package com.mdd.front.controller;


import com.mdd.common.aop.NotLogin;
import com.mdd.common.base.page.PageValidate;
import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
import com.mdd.front.service.IBannerService;
import com.mdd.front.validate.banner.BannerSearchValidate;
import com.mdd.front.vo.banner.BannerListedVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

@RestController
@RequestMapping("api/banner")
@Api(tags = "广告数据管理")
public class BannerController {

    @Resource
    IBannerService iBannerService;

    @GetMapping("/list")
    @NotLogin
    @ApiOperation(value="广告列表")
    public AjaxResult<PageResult<BannerListedVo>> list(@Validated PageValidate pageValidate,
                                                       @Validated BannerSearchValidate searchValidate) {
        PageResult<BannerListedVo> vos = iBannerService.list(pageValidate, searchValidate);
        return AjaxResult.success(vos);
    }
}
